#pragma once

#include <vector>
#include <string>
#include <map>
#include "Enum.h"
#include "Constants.h"

class Tile;
class Ingredient;
class Misc;
class Potion;
class Tool;
class MeleeWeapon;
class RangedWeapon;
class Npc;
class Player;
class Door;
class ItemContainer;
class Resource;
class Trap;
class Level;
class Wall;
class Portal;
class TextLog;
class ItemStack;
class Equipment;
class RecipeManager;
class Recipe;
class Corpse;
class Scroll;
class Armor;
class Shield;
class Food;
class AvailableTalents;
class Ammo;

class TextureManager;

class Renderer {
protected:
	TextureManager* m_textureManager;
	void renderTexture(unsigned int texture, float x, float y, float width = TILE_WIDTH, float height = TILE_HEIGHT);
	void renderQuad(float x, float y, float width = TILE_WIDTH, float height = TILE_HEIGHT);
	void renderOutline(float x, float y, int lineWidth, float width = TILE_WIDTH, float height = TILE_HEIGHT);
	float renderString(void* font, std::string line, float x, float y, float maxX);
	void* getFont();
public:
	Renderer(TextureManager* textureManager);
	~Renderer();
	void render(const Tile& tile, float x, float y);
	void render(const Ammo& ammo, float x, float y);
	void render(const Armor& armor, float x, float y);
	void render(const Food& food, float x, float y);
	void render(const Corpse& corpse, float x, float y);
	void render(const Ingredient& ingredient, float x, float y);
	void render(const Misc& misc, float x, float y);
	void render(const Potion& potion, float x, float y);
	void render(const Shield& shield, float x, float y);
	void render(const Tool& tool, float x, float y);
	void render(const MeleeWeapon& weapon, float x, float y);
	void render(const RangedWeapon& weapon, float x, float y);
	void render(const Scroll& scroll, float x, float y);
	void render(const Npc& npc, float x, float y);
	void render(const Player& player, float x, float y);
	void render(const Door& door, float x, float y);
	void render(const ItemContainer& itemcontainer, float x, float y);
	void render(const Resource& resource, float x, float y);
	void render(const Trap& trap, float x, float y);
	void render(const Wall& wall, float x, float y);
	void render(const Portal& portal, float x, float y);
	void render(const Level& level, float x, float y, float width, float height);
	void render(const TextLog& log, float x, float y, float width, float height);
	void render(const ItemStack& items, float x, float y, float width, float height);
	void render(const Equipment& equipment, float x, float y, float width, float height);
	void renderPlayerInfo(const Player& player, float x, float y, float width, float height);
	void render(const RecipeManager& recipeManager, float x, float y, float width, float height);
	void render(const Recipe& recipe, float x, float y, float width, float height);
	void render(const AvailableTalents& talents, float x, float y, float width, float height);
	void renderSelectSkill(const std::map<Skill, float>& skills, float x, float y, float width, float height);
	void renderSelectNewSkill(const std::map<Skill, float>& skills, float x, float y, float width, float height);
	void renderTitle(float x, float y, float width, float height);
	void renderLoad(const std::vector<std::string>& loadGames, float x, float y, float width, float height);
};
